package cn.edu.wfit.modules.infomanagement.service.impl;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.wfit.modules.infomanagement.mapper.MajorMapper;
import cn.edu.wfit.modules.infomanagement.domain.Major;
import cn.edu.wfit.modules.infomanagement.service.IMajorService;

/**
 * 专业维护Service业务层处理
 * 
 * @author 韩强
 * @date 2024-11-15
 */
@Service
public class MajorServiceImpl implements IMajorService 
{
    @Autowired
    private MajorMapper majorMapper;

    /**
     * 查询专业维护
     * 
     * @param majorId 专业维护主键
     * @return 专业维护
     */
    @Override
    public Major selectMajorByMajorId(Long majorId)
    {
        return majorMapper.selectMajorByMajorId(majorId);
    }

    /**
     * 查询专业维护列表
     * 
     * @param major 专业维护
     * @return 专业维护
     */
    @Override
    public List<Major> selectMajorList(Major major)
    {
        return majorMapper.selectMajorList(major);
    }

    /**
     * 新增专业维护
     * 
     * @param major 专业维护
     * @return 结果
     */
    @Override
    public int insertMajor(Major major)
    {
        major.setCreateTime(DateUtils.getNowDate());
        return majorMapper.insertMajor(major);
    }

    /**
     * 修改专业维护
     * 
     * @param major 专业维护
     * @return 结果
     */
    @Override
    public int updateMajor(Major major)
    {
        major.setUpdateTime(DateUtils.getNowDate());
        return majorMapper.updateMajor(major);
    }

    /**
     * 批量删除专业维护
     * 
     * @param majorIds 需要删除的专业维护主键
     * @return 结果
     */
    @Override
    public int deleteMajorByMajorIds(Long[] majorIds)
    {
        return majorMapper.deleteMajorByMajorIds(majorIds);
    }

    /**
     * 删除专业维护信息
     * 
     * @param majorId 专业维护主键
     * @return 结果
     */
    @Override
    public int deleteMajorByMajorId(Long majorId)
    {
        return majorMapper.deleteMajorByMajorId(majorId);
    }
}
